import request from '@/utils/request'

// 查询上架任务列表
export function listPutTask(query) {
  return request({
    url: '/wms/putTask/list',
    method: 'get',
    params: query
  })
}

// 初始化
export function initBean(query) {
    return request({
        url: '/wms/putTask/initBean',
        method: 'post',
        params:query
    })
}

// 查询上架任务详细
export function getPutTask(id) {
  return request({
    url: '/wms/putTask/' + id,
    method: 'get'
  })
}

// 查询上架任务详细
export function getPutTaskByTask(id) {
  return request({
    url: '/wms/putTask/getTaskInfo/' + id,
    method: 'get'
  })
}

// 新增上架任务
export function addPutTask(data) {
  return request({
    url: '/wms/putTask',
    method: 'post',
    data: data
  })
}

// 修改上架任务
export function updatePutTask(data) {
  return request({
    url: '/wms/putTask',
    method: 'put',
    data: data
  })
}

// 删除上架任务
export function delPutTask(id) {
  return request({
    url: '/wms/putTask/' + id,
    method: 'delete'
  })
}

//拆箱
export function delUnpacking(boxId,id) {
  return request({
    url: '/wms/putTask/unpacking/' + boxId+'/'+id,
    method: 'post'
  })
}

// 查询上架附件信息
export function getPics(id) {
  return request({
    url: '/wms/putTask/getPics/' + id,
    method: 'get'
  })
}


// 重载上架任务
export function refreshWarehouse(data) {
  return request({
    url: '/wms/putTask/refresh',
    method: 'post',
    data: data
  })
}